What is where did 3 sheets to the wind come from?

The expression "three sheets to the wind" originated from the nautical term "sheet," which refers to the ropes that control the sails of a ship. When the sheets of the ship are not secured tightly, the sails become loose, making the ship unsteady and difficult to control, much like a drunk person stumbling and swaying. Therefore, "three sheets to the wind" is used to describe someone who is severely intoxicated and unable to maintain their balance or stability.